<template>
  <van-nav-bar
      title="订单详情"
      left-text=""
      left-arrow
      @click-left="onClickLeft"
  />
  <div class="dv1">
    <div class="dv2">
      <h3 style="line-height: 10%">{{ order.status }}</h3><br>
<!--      <p style="line-height: 20%">感谢您对喜茶的支持，欢迎再次光临！</p>-->
<!--      <div>-->
<!--        <van-button color="#7232dd" type="default" to="/order" style="margin-bottom: 20px" >再来一单</van-button>-->
<!--      </div>-->
    </div>
    <div class="dv3">
      <div v-for="good in order.orderGoods">
        <van-card
            :thumb="good.imgurl"
        >
          <template #title>
            <p style="font-size: 15px; position: absolute; left: 10px;bottom: 50px">
              {{good.name}}
            </p>
          </template>
          <template #tags>
            <p style="font-size: 15px; position: absolute; right: 0px;bottom: 15px">
              ￥ {{good.price}}
            </p>
          </template>
          <template #num>
            <p style="position: absolute; bottom:20px; right: 0px;bottom: 0px">
              共{{good.goodsNum}}件
            </p>
          </template>
        </van-card>
      </div>
      <div style="height: 50px;background-color: #F6F6F6">
        <p style="position: absolute; left: 5px">商品总价</p>
        <p style="position: absolute; right: 5px">￥{{order.totalPrice}}</p>
      </div>
      <div style="margin-top: 2px;background-color: #F6F6F6;height: 150px">
        <h3 style="position: absolute; left: 5px">订单信息</h3><br><br><br>
        <p style="position: absolute; left: 5px">下单时间: {{order.ctime}}</p><br><br>
        <p style="position: absolute; left: 5px">订单编号:{{order.orderNo}}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "OrderDetail",
  data(){
    return{
      order:JSON.parse(this.$store.state.detail),
    }
  },methods:{
    onClickLeft(){
      history.back()
    }
  }
}
</script>

<style scoped>
.dv1{
  width: 100%;
  height: 100%;
  padding-top: 5px;
}
.dv2{
  padding-top: 10px;
  background-color: #F6F6F6;
}
.dv3{
  padding-top: 10px;
  background-color: #F6F6F6;
}

</style>